﻿
<template>
<div class="card-fill layout-padding">
<el-card shadow="hover" class="layout-padding-auto" >
  <el-form ref="formRefCustomConfig" :model="stateCustomConfig.vmModel" label-width="100px">
    <el-row>
      
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_customProperty_FormItem" prop="Entity.customProperty" label="属性编码">
            <el-input v-model="stateCustomConfig.vmModel.Entity.customProperty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_propertyDescribe_FormItem" prop="Entity.propertyDescribe" label="属性描述">
            <el-input v-model="stateCustomConfig.vmModel.Entity.propertyDescribe" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_propertyValue_FormItem" prop="Entity.propertyValue" label="属性值">
            <el-input v-model="stateCustomConfig.vmModel.Entity.propertyValue" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    </el-row>

    <div style="text-align:right;">
      <WtmButton @click="onCloseCustomConfig"  type="primary" :button-text="$t('message._system.common.vm.cancel')" style="margin-top:15px;"/>
    </div>
  </el-form>

</el-card>
</div>
</template>


<script setup lang="ts" name="message._system.common.vm.detail;false">
import {  ElMessageBox, ElMessage } from 'element-plus';
import { defineAsyncComponent,reactive, ref, getCurrentInstance, onMounted, nextTick } from 'vue';
import { CustomConfigApi } from '/@/api/baseinformation/CustomConfig';
import other from '/@/utils/other';
import fileApi from '/@/api/file';
import { useRouter } from "vue-router";
const ci = getCurrentInstance() as any;

// 定义变量内容
const formRefCustomConfig = ref();
const stateCustomConfig = reactive({
      vmModel: {
	  Entity:{
      			ID: null,
			customProperty: null,
			propertyDescribe: null,
			propertyValue: null,

      },
      
	},
    
     
});

// 取消
const onCloseCustomConfig = () => {
    closeDialog();
};


// 页面加载时
onMounted(() => {
    
     if (ci.attrs["wtmdata"]) {
		stateCustomConfig.vmModel.Entity.ID = ci.attrs["wtmdata"].ID;
	}
	else if (useRouter().currentRoute.value.query.id) {
		stateCustomConfig.vmModel.Entity.ID = useRouter().currentRoute.value.query.id as any;
	}
	CustomConfigApi().get(stateCustomConfig.vmModel.Entity.ID ?? "").then((data: any) => other.setValue(stateCustomConfig.vmModel, data));
});

// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh','closeDialog']);
// 关闭弹窗
const closeDialog = () => {
    emit('closeDialog');
};
// 暴露变量
defineExpose({

});
</script>

<style scoped lang="scss">

</style>

